ac.item('魔法剑'){
    cool = 4,
    used_flag = false,
    item_type = 'permanent',
}
ac.buff('魔法剑'){
    model1 = [[ZBJN_mfj.mdl]],
    on_add = function(self)
		local unit = self.owner
        self:gc(unit:event '单位-攻击命中'(function(_,_,target,data)
            if self.item:is_cooling()==false and math.random(100)<=12 then
                self.item:active_cd()
                local point1 = unit:get_point()
                local point2 = target:get_point()
                local angle = point1 / point2
                local point = point2 - {angle,-100}
                local damage = unit:get('攻击') * 3
                point:effect{
                    model = self.model1,
                    angle = angle,
                    size = 0.6,
                    time = 0.2,
                }
                unit:aoe_damage(point2,250,damage,self)
            end
        end))
    end,
}


ac.buff('战斗号角'){
    on_add = function(self)
		local unit = self.owner
        if unit:is_type('英雄') then
            self:gc(unit:add_buff '战斗号角-效果'{art=self.art})
        end
    end,
}

ac.buff('战斗号角-效果'){
    keep = 1,
    cover_max = 1,
    cover_type = 1,
    tip = [[移动+100，每秒金币+5]],
    on_add = function(self)
        ac.each_hero(function(hero)
            self:gc(hero:add('移动速度',100))
            self:gc(hero:add('每秒金币',5))
        end)
    end
}



ac.buff('双生之影'){
    on_add = function(self)
		local unit = self.owner
        self:gc(unit:add('多重数量',1))
    end,
}


ac.buff('巨力拳套'){
    on_add = function(self)
		local unit = self.owner
        self:gc(unit:add('弹射次数',1))
    end,
}


ac.buff('亡灵护符'){
    on_add = function(self)
		local unit = self.owner
        local player = unit.owner
        self:gc(unit:event '英雄-击杀单位'(function(trg)
            self.item:add_count(1)
            if self.item:get_count()>=1000 then
                local gold = math.random(100,250)
                local text = ('亡灵护符：全属性+%s'):format(gold)
                self.item:set_count(0)
                player:send_msg(text)
                unit:add('全属性',gold)
                pz(self.title or self.name,unit)
            end
        end))
    end,
}



ac.buff('碎颅者巨斧'){
    on_add = function(self)
		local unit = self.owner
        self:gc(ac.loop(1000,function()
            self.item:add_count(1)
            if self.item:get_count()>=30 then
                self.item:set_count(0)
                unit.owner:add_icon('杀敌',50)
            end
        end))
    end,
}

